package com.ojoin.trade.supplyloan_core.web.dao.impl;

import com.ojoin.trade.common.exception.BusinessException;
import com.ojoin.trade.common.exception.DaoException;
import com.ojoin.trade.common.web.dao.impl.BaseDaoImpl;
import com.ojoin.trade.supplyloan_core.web.dao.TbSlBankaccDao;
import com.ojoin.trade.supplyloan_core.web.domain.TbSlBankacc;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created with IntelliJ IDEA.
 * User: Administrator
 * Date: 16-1-8
 * Time: 下午5:27
 * To change this template use File | Settings | File Templates.
 */
@Repository
public class TbSlBankaccDaoImpl extends BaseDaoImpl<TbSlBankacc> implements TbSlBankaccDao {
    @Override
    public List<TbSlBankacc> queryBankaccByJoinid(int idOfTbMerchantUser) throws BusinessException {

        String mapMethodName = "selectByjoinid";
        try {
            List list = this.sqlSessionTemplate.selectList(getSqlName(mapMethodName),idOfTbMerchantUser);
            return list;
        } catch (Exception e) {
            throw new DaoException(String.format("查询商户的供应链贷款的提现账户出错！语句：%s",
                    getSqlName(mapMethodName)), e);
        }
    }
}
